#!bin/sh
cat $1 |
awk '
	BEGIN 	{
			current = ""; indeg = ""; pathlen = ""; clustcoef = ""; diam = ""; peers = "";
			print("Round number; Av. in-degree; Av. path length; Clustering coef; Diameter; # of Peers");
		}
	$1 ~ /current/ {current = $3;}
	$2 ~ /in-degree:/ {indeg = $3;}
	$2 ~ /path/ {pathlen = $4}
	$1 ~ /Clustering-coefficient:/ {clustcoef = $2}
	$1 ~ /Diameter:/ {diam = $2}
	$4 ~ /peers:/ {peers = $5}
	$1 ~ /###/ {
			printf("%s %s %s %s %s %s\n", current, indeg, pathlen, clustcoef, diam, peers);
			current = ""; indeg = ""; pathlen = ""; clustcoef = ""; diam = ""; peers = "";
		}
' |
sed -r 's/,/./g'
